<?php

/**
 * Class provides useful interface to loading and saving configurations
 *
 * @package Rapide_Config
 */
class Rapide_Config extends Rapide_Parameters
{
	/**
	 * PHP configuration
	 *
	 */
	const PHP = 1;
	/**
	 * XML configuration
	 *
	 */
	const XML = 2;
	/**
	 * INI configuration
	 *
	 */
	const INI = 3;

	/**
	 * Load configuration from given file
	 * 
	 * <p>You can give relative path to the configuration file.
	 * Rapide_Config will try to load this file from configuration directory.</p>
	 *
	 * <p>By default Rapide_Config loads date from PHP arrays if type has not
	 * been specified. For example:</p>
	 * 
	 * <code>$oConfig->load('Database.php');</code>
	 *
	 * @param string $sFile file name
	 * @param int $iType type of configuration
	 */
	public function load($sFile, $iType = self::PHP)
	{
		$aConfig = Rapide_Config_Loader_PhpArray::load($sFile);

		$this->append($aConfig);
	}

	/**
	 * Save current configuration to the given file name
	 *
	 * @param string $sFile file name
	 * @param int $iType type of configuration
	 */
	public function save($sFile, $iType = self::PHP)
	{
		Rapide_Config_Saver_PhpArray::save($this->_aParameters, $sFile);
	}
}

?>